package design_modle.factory;

public class CashFactory {
    public static CashSuper createCashAdapter(String type) {
        return switch (type){
            case "正常收费" -> new CashNomal();
            case "满300返100" -> new CashReturn(300 , 100);
            case "打8折" ->new CahRebate(0.8);
            default -> throw new IllegalStateException("Unexpected value: " + type);
        };
    }
}
